<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery3.3.1.js"></script>
    <style>
        #box p{width: 100px;height: 100px;margin: 0 auto;background: yellow;}
    </style>
</head>
<body>
    <div id="box">
        toggle（）事件
        <p>1</p>
    </div>
    <script>
        // toggleClass()集合啦addclass和remoceclass
        // toggle() 模拟鼠标连续的click事件,这个事件集合了show()和hide()方法
        $(function(){
            $(document).click(function(){
                $("#box").toggle(3000);
            })
        })
    </script>
</body>
</html>